const mongoose = require("mongoose");

// 消除严格模式
mongoose.set("strictQuery", true);

mongoose.connect(
    "mongodb://pet:123456@101.43.214.96:27017/pet?authSource=pet"
);

const conn = mongoose.connection;

conn.on("open", () => {
    console.log("连接成功");
});

conn.on("error", (err) => {
    console.log("连接失败");
    console.log(err);
});

module.exports = mongoose;
